@mixin circle-dot() {
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0, 0, 0, 0.3), 0 0 1px 2px rgba(0, 0, 0, 0.4);
  height: 4px;
  transform: translate(-2px, -2px);
  width: 4px;
}

.#{$color-picker-prefix-cls} {
  display: inline-block;

  &-hide {
    display: none;

    &-drop {
      visibility: hidden;
    }
  }

  &-disabled {
    @include disabled();
  }

  & > div:first-child:hover {
    .ivu-input {
      @include hover();
    }
  }
  & > div:first-child.#{$color-picker-prefix-cls}-disabled:hover {
    .ivu-input {
      border-color: tint($input-border-color, 20%);
    }
  }
  & .#{$select-dropdown-prefix-cls} {
    padding: 0;
  }

  &-input.ivu-input:focus {
    box-shadow: none;
  }

  &-focused {
    @include active();
  }

  &-rel {
    line-height: 0;
  }

  &-color {
    background-image: url();
    border-radius: 2px;
    height: 18px;
    position: relative;
    top: 2px;
    width: 18px;

    div {
      border-radius: 2px;
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
      height: 100%;
      width: 100%;
    }

    &-empty {
      background: #fff;
      overflow: hidden;
      text-align: center;

      i {
        font-size: 18px;
        vertical-align: baseline;
      }
    }

    &-focused {
      @include active();
    }
  }

  &-large &-color {
    height: 20px;
    top: 1px;
    width: 20px;

    &-empty {
      i {
        font-size: 20px;
      }
    }
  }

  &-small &-color {
    height: 14px;
    top: 3px;
    width: 14px;

    &-empty {
      i {
        font-size: 14px;
      }
    }
  }

  &-picker {
    &-wrapper {
      padding: 8px 8px 0;
    }

    &-panel {
      box-sizing: initial;
      margin: 0 auto;
      position: relative;
      width: 240px;
    }

    &-hue-slider,
    &-alpha-slider {
      height: 10px;
      margin-top: 8px;
      position: relative;
    }

    &-colors {
      border-radius: 2px;
      margin-top: 8px;
      overflow: hidden;
      transition: border $transition-time $ease-in-out, box-shadow $transition-time $ease-in-out;

      &:focus {
        @include active();
      }

      &-wrapper {
        display: inline;
        float: left;
        height: 20px;
        position: relative;
        width: 20px;

        &-color {
          border-radius: 2px;
          box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
          cursor: pointer;
          display: block;
          height: 16px;
          margin: 2px;
          outline: 0;
          position: absolute;
          width: 16px;
        }

        &-circle {
          @include circle-dot();
          cursor: pointer;
          left: 10px;
          position: absolute;
          top: 10px;
        }
      }
    }
    .#{$picker-prefix-cls}-confirm {
      margin-top: 8px;
    }
  }

  &-saturation {
    &-wrapper {
      padding-bottom: 75%;
      position: relative;
      //overflow: hidden;
      transition: border $transition-time $ease-in-out, box-shadow $transition-time $ease-in-out;
      width: 100%;

      &:focus {
        @include active();
      }
    }

    &,
    &--white,
    &--black {
      bottom: 0;
      cursor: pointer;
      left: 0;
      position: absolute;
      right: 0;
      top: 0;
    }

    &--white {
      background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
    }

    &--black {
      background: linear-gradient(to top, #000, rgba(0, 0, 0, 0));
    }

    &-pointer {
      cursor: pointer;
      position: absolute;
    }

    &-circle {
      @include circle-dot();
    }
  }

  &-hue {
    background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
    border-radius: 2px;
    bottom: 0;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;

    transition: border $transition-time $ease-in-out, box-shadow $transition-time $ease-in-out;

    &:focus {
      @include active();
    }

    &-container {
      cursor: pointer;
      height: 100%;
      margin: 0 2px;
      position: relative;
    }

    &-pointer {
      position: absolute;
      z-index: 2;
    }

    &-picker {
      background: #fff;
      border-radius: 1px;
      box-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
      cursor: pointer;
      height: 8px;
      margin-top: 1px;
      transform: translateX(-2px);
      width: 4px;
    }
  }

  &-alpha {
    border-radius: 2px;
    bottom: 0;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;

    transition: border $transition-time $ease-in-out, box-shadow $transition-time $ease-in-out;

    &:focus {
      @include active();
    }

    &-checkboard-wrap {
      border-radius: 2px;
      bottom: 0;
      left: 0;
      overflow: hidden;
      position: absolute;
      right: 0;
      top: 0;
    }

    &-checkerboard {
      background: url();
      bottom: 0;
      left: 0;
      position: absolute;
      right: 0;
      top: 0;
    }

    &-gradient {
      border-radius: 2px;
      bottom: 0;
      left: 0;
      position: absolute;
      right: 0;
      top: 0;
    }

    &-container {
      cursor: pointer;
      height: 100%;
      margin: 0 3px;
      position: relative;
      z-index: 2;
    }

    &-pointer {
      position: absolute;
      z-index: 2;
    }

    &-picker {
      background: #fff;
      border-radius: 1px;
      box-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
      cursor: pointer;
      height: 8px;
      margin-top: 1px;
      transform: translateX(-2px);
      width: 4px;
    }
  }

  &-confirm {
    border-top: 1px solid $border-color-split;
    clear: both;
    margin-top: 8px;
    padding: 8px;
    position: relative;
    text-align: right;

    &-color {
      left: 8px;
      position: absolute;
      top: 11px;

      &-editable {
        right: 110px;
        top: 8px;
      }
    }
  }
}
